package panda.query.struct;


public class FloatConstant implements Constant {
	
	static final double eps = 0.000000000000000000000001;
	
	private Float value;
	
	public FloatConstant(float value) {
		this.value = value;
	}

	public Object getContentValue() {
		return value;
	}

	public int compareTo(Constant o) {
		if (o instanceof NullConstant) return -Integer.MAX_VALUE;
		
		return value.compareTo(((FloatConstant)o).value);
	}

	@Override
	public boolean getBooleanValue() {
		// TODO Auto-generated method stub
		return !(Math.abs(value) < eps);
	}

	@Override
	public float getFloatValue() {
		return value;
	}

	@Override
	public int getIntValue() {
		return value.intValue();
	}

	@Override
	public String getStringValue() {
		return value.toString();
	}
	
	

}
